layui.use(['form', "fsConfig", "fsCommon", "table"], function () {
    var form = layui.form,
        table = layui.table,
        layer = layui.layer,
        fsCommon = layui.fsCommon,
        fsConfig = layui.fsConfig,
        serverUrl = $.result(fsConfig, "global.serverUrl"),
        jumpLogin = $.result(fsConfig, "filters.401");

    var token = localStorage.getItem('cdce_serivce_token');
    if (token === "") {
        jumpLogin()
    }

    function callbackfun(data) {
        if(data.data.length == 0) {
            return
        }
        table.render({
            elem: '#cost_info'
            , cols: [[
                {field: 'id', width: 80, title: 'ID'}
                , {field: 'pay_num', width: 180, title: '支付帐号'}
                , {field: 'school_time',width: 280, title: '考试时间'}
                , {field: 'batch_name', title: '统考批次'}
                , {field: 'amount', title: '金额'}
                , {field: 'status', title: '是否支付', templet: '#PayStatus'}
            ]]
            , data: data.data
        });
    }

    fsCommon.get("/costs/v1alpha/infos", "", callbackfun);
});